{extend name="public/base" /}

{block name="title"}<title>{if condition="$data"}{$Think.lang.edit}{else /}{$Think.lang.create}{/if}</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>评论信息</h1>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 评论信息</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST" action="" onsubmit="return false" >
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab1" data-toggle="tab">{$Think.lang.base_param}</a></li>
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> {$Think.lang.back}</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">
                            <input type="hidden" name="id" value="{$data.id}" />
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.title}</label>
                                <div class="col-sm-7"><input class="form-control" name="title" value="{$data.title}" placeholder="{$Think.lang.title}"></div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.text}</label>
                                <div class="col-sm-7"><textarea class="form-control" style="resize:none;height:155px;" name="text" placeholder="{$data.text}"></textarea></div>
                            </div>
<!--                            <div class="form-group">-->
<!--                                <label class="col-sm-2 control-label">{$Think.lang.web}</label>-->
<!--                                <div class="col-sm-7"><input class="form-control" name="web" value="{$data.web}" placeholder=""></div>-->
<!--                            </div>-->
<!--                            <div class="form-group">-->
<!--                                <label class="col-sm-2 control-label">{$Think.lang.all_name}</label>-->
<!--                                <div class="col-sm-7"><input class="form-control" name="all_name" value="{$data.all_name}" placeholder=""></div>-->
<!--                            </div>-->
<!--                            <div class="form-group">-->
<!--                                <label class="col-sm-2 control-label">{$Think.lang.money}</label>-->
<!--                                <div class="col-sm-7"><input class="form-control" name="money" value="{$data.money}" placeholder=""></div>-->
<!--                            </div>-->
<!--                            <div class="form-group">-->
<!--                                <label class="col-sm-2 control-label">{$Think.lang.all_name}</label>-->
<!--                                <div class="col-sm-7"><input class="form-control" name="all_name" value="{$data.all_name}" placeholder=""></div>-->
<!--                            </div>-->
<!--                            <div class="form-group">-->
<!--                                <label class="col-sm-2 control-label">{$Think.lang.legal_person}</label>-->
<!--                                <div class="col-sm-7"><input class="form-control" name="legal_person" value="{$data.legal_person}" placeholder=""></div>-->
<!--                            </div>-->



                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.people_id}</label>
                                <div class="col-sm-7">
                                    <select name="people_id" id="people_id"  onchange="a()" class="form-control" style="width:33%;display:inline-block;">
                                        {volist name='people_id' id='people'}
                                        <option value="{$people.id}"
                                                {notempty name="$people.id"}
                                                {eq name="$people.id" value="$data.people_id"}
                                                selected=""{/eq}{/notempty}>{$people.people}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
<!--                   融资        company_financing  表名  option value="{$financing.id}" 对应的是表字段的名   -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.financing_id}</label>
                                <div class="col-sm-7">
                                    <select name="financing_id" id="financing_id" onchange="a()" class="form-control" style="width:33%;display:inline-block;">
                                        {volist name='financing_id' id='financing'}
                                        <option value="{$financing.id}"{notempty name="financing.id"}
                                                {eq name="financing.id" value="$data.people_id"}
                                        selected=""{/eq}{/notempty}

                                        >{$financing.financing_name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>

<!--                            <div class="form-group">-->
<!--                                <label class="col-sm-2 control-label">{$Think.lang.financing_id}</label>-->
<!--                                <div class="col-sm-7">-->
<!--                                    <select class="form-control select2" name="financing_id" style="width:100%;">-->
<!--                                        {volist name="financing_id" id="financing"}-->
<!--                                        <option value="{$financing.id}" {notempty name="$financing.id"}-->
<!--                                                {eq name="$financing.id" value="$data.financing_id"} selected=""{/eq}{/notempty}>-->
<!--                                        {$financing.financing_name}</option>-->
<!--                                        {/volist}-->
<!--                                    </select>-->
<!--                                </div>-->
<!--                            </div>-->


                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.province}</label>
                                <div class="col-sm-7">
                                    <select name="province" id="province"   class="form-control" style="width:33%;display:inline-block;">
                                        <option value="">--选择省--</option>
                                    {volist name='province' id='vo'}
                                    <option value="{$vo.province_id}" {notempty name="data"} {if $vo.province_id==$data.province}selected{/if}{/notempty}>{$vo.name}</option>
                                    {/volist}
                                </select></div>
                            </div>
                            <div class="form-group">
                            <label class="col-sm-2 control-label">{$Think.lang.city}</label>
                            <div class="col-sm-7"> <select name="city" id="city"   class="form-control" style="width:33%;display:inline-block;">
                                <option>--请选择市--</option>
                                {notempty name='city'}
                                {volist name='city' id='vo'}
                                <option value="{$vo.city_id}" {if $vo.city_id==$data.city}selected{/if}>{$vo.name}</option>
                                {/volist}
                                {/notempty}
                            </select></div>
                        </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.district}</label>
                                <div class="col-sm-7"><select name="district" id="district"   class="form-control" style="width:33%;display:inline-block;">
                                    <option>--请选择县--</option>
                                    {notempty name='district'}
                                    {volist name='district' id='vo'}
                                    <option value="{$vo.district_id}"  {if $vo.district_id==$data.district}selected{/if}>{$vo.name}</option>
                                    {/volist}
                                    {/notempty}
                                </select></div>
                            </div>
<!--                详情地址            -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.site}</label>
                                <div class="col-sm-7"><input class="form-control" name="site" value="{$data.site}" placeholder=""></div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.detailed_address}</label>
                                <div class="col-sm-7"   ><textarea class="form-control" style="resize:none;height:155px;"   value=""  name="detailed_address" placeholder="">{$data.detailed_address}</textarea></div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">{$Think.lang.status}</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="status" style="width:100%;">
                                        <option value="1" {if condition="$data.status eq '1'"}selected="selected"{/if} >{$Think.lang.status1}111</option>
                                        <option value="0" {if condition="$data.status eq '0'"}selected="selected"{/if} >{$Think.lang.status0}</option>
                                    </select>
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-7">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right submits" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; {$Think.lang.submit}">{$Think.lang.submit}</button>
                            </div>
                            <div class="btn-group pull-left">
                                <button type="reset" class="btn btn-warning">{$Think.lang.reset}</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>
<script type="text/javascript">
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });
    
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $(".select2").select2({language:"zh-CN"});
    
    {if condition=" $rest_login == 1 "}
    restlogin('{$rest_login_info}');   //登录超时
    {/if}
})
</script>
<script type="text/javascript">
    $(function () {
        $('#province').change(function () {
            var name = $(this).val();
            var html = '';
            var htmls = '';

            if(name==''){
                $('#city').html("<option value=''>请选择市---</option>");
                $('#district').html("<option value=''>请选择县/区---</option>");
                return;
            }
            $.ajax({
                type:'get',
                url:"{:url('admin/linkage/index')}",
                data:{
                    'name':name
                },
                success:function (e) {
                    for(var i=0;i<e[0].length;i++){
                        html+=`
                    <option value="`+e[0][i]['city_id']+`">`+e[0][i]['name']+`</option>
                    `
                    }
                    for(var x=0;x<e[1].length;x++){
                        htmls+=`
                    <option value="`+e[1][x]['district_id']+`">`+e[1][x]['name']+`</option>
                    `
                    }
                    $('#city').html(html);
                    $('#district').html(htmls);
                }
            })
        });
        $('#city').change(function () {
            var name = $(this).val();
            if(name==''){
                $('#district').html("<option value=''> 请选择/区-----</option>>");
                return;
            }
            var html = '';
            $.ajax({
                type: 'get',
                url:"{:url('admin/inkage/index')}",
                data:{
                    'city':name
                },
                success:function (e) {
                    for(var i=0;i<e.length;i++){
                        html+=`<option value="`+e[i]['district_id']`">`+e[i]['name']+`</option>`
                    }
                    $('#district').html(html);
                }
            })
        })
    })
</script>
{/block}